Hello and welcome back to our costs about summary statistics.
So why are some of these statistics useful.
Um yeah let's assume you have an array with 1000 or 10000 elements and you want to summarize these elements
in one or two numbers.
And for this task an umpire provides us with many options how to summarize in large numerical arrays.
So first of all that's the important umpire.
Then we create uh eleven random integers in the range one to one hundred and assign the variable A.
Then we start a net we can see so now we have uh the lowest numbers eighteen forty eight and the highest
integers ninety nine.
And then we can calculate the maximum of our array.
So the highest element with the method top Max it's ninety nine here.
And we can also do this trap here by applying the function and picked up Max.
So this gives us uh the same result.
And earlier we learned about the function Max.
So we can also apply the function Max.
So we can see them.
Yeah actually three alternatives to calculate the maximum and also with the minimum they are the same
three alternatives.
Um.
And I only show here the number pi method.
Duckman so I would expect 18 and we can also calculate the mean of all elements that end put up mean.
So it's seventy four are we use the method that mean should be the same.
And we can also calculate the median.
So let's run it.
Eighty four.
So what is uh the median so the median gets less.
Actually the point where 50 percent of all other points are lower than and 50 percent of all elements
are higher than the median.
So we have eleven elements the median is the sixth element.
So we have five elements which are lower than the median and five elements which are higher than the
median.
So this is a very simple words.
And in the simple example here the median and we can also calculate the standard deviation of our lower
elements.
So it gives us 24.
So the standard deviation is a measure of the liability of our elements.
So if all elements would be let's say 50 our standard deviation would be zero.
If the variability is quite high so then also the standard deviation is high but I don't want to go
into statistical details here and our variance is also a measure of the reliability.
And actually standard deviation is the square root of variance.
But this is not a cross about statistics actually.
And we can also calculate the person tile off our array.
So let's say the here the function and p dot percentile.
We have our array and then we say we want to determine our 10th percentile and it's forty eight.
So what.
What does it mean exactly.
So the 10th percentile means that this is the point actually where 10 percent of all the other elements
are lower than this point and 90 percent are higher.
So you can see here we have the 10th percentile forty eight.
And while that one element is lower and the other nine elements are higher.
So this is an easy words.
And the person type and also we can calculate the 19th percentile so it's 98 and you can see here 90
percent of our elements are lower than the 19th percentile.
So we have four main elements and only 10 percent or in this case one element is higher than the 19th
percentile.
All right so let's again create a an array with eleven random integers in the range between 1 and 100
and let's call it a and we create another array with them.
Eleven random integers in the range 1 and 101 but you can see here.
So we have a different random seed and I would expect now that we get different random numbers here
for our array B there can see here.
So the arrays are different.
Now we can calculate the covariance of A and B with the function and p dot Cove
and the covariance is actually measure how to erase the two sequences of numbers that move together
so he it gives us a matrix.
Um the first element is actually the parents of element on Empire A.
Then here we have the variance of our array B.
And here we have two times them.
The covariance of A and B.
So as you can see here is the minus sign both sequences should be kind of negatively correlated and
we can better see this then by calculating the correlation coefficient by using the function N.P. dot
Car Co F so also here we get here.
This is the correlation of array avers itself.
It's 1 now.
So it's no surprise that a is perfectly correlated with a B you get the correlation of our repeats with
itself.
And here we now we have two times.
The correlation of a and b and it's negative.
So whenever a increases B should have a tendency to decrease and the correlation coefficient as they
are between minus 1 and 1 and minus 1 means a perfect negative correlation and one means the perfect
positive correlation and correlation of zero means actually no correlation.
So he can see we have a slight negative correlation between num PIRA a and b and actually because we
created both arrays Yeah independently and randomly we would expect actually to have zero correlation
between those two.
And if you would increase the the amount of elements in each array so let's say instead of having eleven
one thousand elements then I would assume that we get a correlation which is very close to zero.
All right so this is it.
This wasn't a quick overview or a summary statistic.
So there are a lot of options here none pi and in the next session with the US again with the realisation
and regression with an umpire.
See you there.